﻿namespace UnityEditor
{
    using System;
    using UnityEngine;

    [Serializable]
    internal class AnimFloat : AnimValue
    {
        [SerializeField]
        private float m_Value;

        public AnimFloat()
        {
            this.m_Value = 0f;
        }

        public AnimFloat(float val)
        {
            this.m_Value = val;
        }

        public static implicit operator float(AnimFloat v)
        {
            return v.m_Value;
        }

        internal override void Update()
        {
            this.m_Value = Mathf.Lerp((float) base.m_Source, this.target, base.smoothed);
        }

        public float target
        {
            get
            {
                return (float) base.GetTarget(this.m_Value);
            }
            set
            {
                base.BeginAnimating(value, this.m_Value);
            }
        }

        public float value
        {
            get
            {
                return this.m_Value;
            }
            set
            {
                this.m_Value = value;
                base.StopAnim(value);
            }
        }
    }
}

